#ifndef FactorManagerBase__
#define FactorManagerBase__

#include "FactoryLib/OcRxPublic.h"
template<class ProductType, class ClassFactor>
class FactorManagerBase
{
public:
	FactorManagerBase(void);
	virtual ~FactorManagerBase(void);

protected:
	
	virtual ClassFactor * _Creat(ProductType type, void* pData = NULL);
	virtual void destroy(ProductType type, ClassFactor *Obj, void* pData = NULL);

public:  
	virtual BOOL RegisitFactory(ProductType type, OcRxFactory<ProductType, ClassFactor> *pclass, bool blnChange = true);
  void DeleteFactorys();

protected:
 
	OcRxFactory<ProductType, ClassFactor> * mFactory;
	std::map<ProductType, OcRxFactory<ProductType, ClassFactor>* > mFactorys;
};


#include "FactorManagerBase.INL"


#endif